import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.*;

import java.util.stream.Stream;

public class junitTest03 {
    public static Stream<Arguments> Test() {
        return Stream.of(Arguments.arguments("1,张三","2,李四"
        ));
    }

    @ParameterizedTest
    @ValueSource(ints = {1})//单参数 传递数据类型一致
    void Test01(int num) {
        System.out.println(num);
        //Assertions.assertEquals(1,num);
        //Assertions.assertNotEquals(1,num);
        String str = "null1";
        Assertions.assertNull(str);
    }

    @ParameterizedTest
    @CsvSource({"1,2,3,''"})
    void Test02(int x,int y,int z,String q) {
        System.out.println(x);
        System.out.println(y);
        System.out.println(z);
        System.out.println(q);
        System.out.println("========");
    }

    @ParameterizedTest
    @CsvFileSource(resources = "test02.csv")
    void Test03(int num,String name) {
        System.out.println(num + name);
    }


    @ParameterizedTest
    @MethodSource("Test")
    void Test04(String num,String name) {
        System.out.println(num+name);
    }

}
